<template>
  <div class="big-guess">
    <div class="guessLike">
      <div class="header">
        <div class="header-left">猜你喜欢</div>
        <div class="header-right">为你甄选最合适的</div>
        <div class="header-bottom"></div>
      </div>
      <div class="content">
        <div
          class="single-content"
          v-for="guessContent in guessContent"
          :key="guessContent.itemId"
        >
          <img :src="guessContent.imgUrl" />
          <div class="single-content-word">
            <div class="content-word-name">{{ guessContent.title }}</div>
            <div class="content-word-assess">
              {{ guessContent.commentNum }}个评价
            </div>
            <div class="content-word-place">{{ guessContent.areaName }}</div>
          </div>
          <div class="content-word-price">
            ￥<em>{{ guessContent.lowPrice }}</em> 起
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "take-outFood",
};
</script>

<script setup>
import { getGuessYourLike } from "../../api/outFood/index";
import { onMounted, ref } from "vue";
const guessContent = ref([]);
onMounted(async () => {
  const result = await getGuessYourLike();
  guessContent.value = result;
});
</script>

<style scoped>
* {
  margin: 0 auto;
}
.big-guess {
  background-color: #f8f8f8;
}
.guessLike {
  background-color: #ffffff;
  width: 1200px;
}
.header {
  display: flex;
  align-items: center;
  background-color: #4eb5d5;
  width: 1200px;
  height: 45px;
  border-radius: 10px 10px 0 0;
  color: #fff;
  position: relative;
}
.header-left {
  font-size: 20px;
  margin-left: 20px;
}
.header-right {
  font-size: 14px;
  position: absolute;
  left: 118px;
}
.header-bottom {
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 9px solid #f8f8f8;
  border-radius: 2px;
  position: absolute;
  bottom: 0;
  left: 164px;
}
.content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  margin-top: 8px;
  padding: 0 15.5px;
  width: 100%;
}
.single-content {
  margin: 6px 0;
  padding-bottom: 4px;
  border-radius: 5px;
  width: 220px;
  padding: 8px;
}
.single-content:hover {
  background-color: #f4f4f4;
}
.single-content img {
  width: 214px;
  height: 140px;
  border: 1px solid transparent;
  border-radius: 7px;
  background-size: cover;
}
.single-content-word {
  margin: 2px 0;
}
.content-word-name {
  font-size: 16px;
  width: 213px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.content-word-assess {
  color: #999999;
  margin: 4px 0;
  padding-top: 3px;
}
.content-word-place {
  color: #999999;
}
.content-word-price {
  margin-top: 5px;
  color: #ff6600;
}
.content-word-price em {
  font-size: 19px;
}
</style>